package com.itheima.dubbo.samples.echo;

import com.itheima.dubbo.samples.api.EchoService;
import org.apache.dubbo.config.ApplicationConfig;
import org.apache.dubbo.config.ReferenceConfig;
import org.apache.dubbo.config.RegistryConfig;

public class EchoCustomer {

    public static void main(String[] args) {

        ReferenceConfig<EchoService> reference = new ReferenceConfig<>();
        reference.setApplication(new ApplicationConfig("java-echo-customer"));
        reference.setRegistry(new RegistryConfig("zookeeper://192.168.56.100:2181"));
        reference.setInterface(EchoService.class);
        EchoService echoService = reference.get();
        String message = echoService.echo("Hello world");
        System.out.println(message);
    }
}
